*******************************************************************************
* Load data
*******************************************************************************

use dataset_polls_meta, clear

keep if appendix == 1

*******************************************************************************
* Make tables
*******************************************************************************

local j = 1

foreach x in fraudnational fraudfl electoralcollege hacking {

	#delimit;
	
	listtex date house `x'wording `x'1 `x'0 if `x'wording != "na"
		using "_output/table_appendix_reasons_polls_`j'.tex"
		,
		replace
		type rstyle(tabular)
		head(
			\begin{tabular}{
				p{0.1\textwidth}
				p{0.15\textwidth}
				p{0.3\textwidth}
				p{0.2\textwidth}
				p{0.2\textwidth}			
			}
			\toprule 
			Date & House & Wording & Coded 1 & Coded 0
			\\
			\midrule
		)
		foot("\bottomrule\end{tabular}")
		;
		
	#delimit cr
		
	local j = `j' + 1

}

*******************************************************************************
* End
*******************************************************************************
